home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 4.1 KB | 142 lines | [TEXT/MPS ] |
- {
- File: Dictionary.p
-
- Copyright: © 1984-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- }
-
- {$IFC UNDEFINED UsingIncludes}
- {$SETC UsingIncludes := 0}
- {$ENDC}
-
- {$IFC NOT UsingIncludes}
- UNIT Dictionary;
- INTERFACE
- {$ENDC}
-
- {$IFC UNDEFINED __DICTIONARY__}
- {$SETC __DICTIONARY__ := 1}
-
- {$I+}
- {$SETC DictionaryIncludes := UsingIncludes}
- {$SETC UsingIncludes := 1}
-
-
- {$IFC UNDEFINED __TYPES__}
- {$I Types.p}
- {$ENDC}
- { ConditionalMacros.p }
-
- {$IFC UNDEFINED __FILES__}
- {$I Files.p}
- {$ENDC}
- { MixedMode.p }
- { OSUtils.p }
- { Memory.p }
-
- {$PUSH}
- {$ALIGN MAC68K}
- {$LibExport+}
-
- CONST
- { Dictionary data insertion modes }
- kInsert = 0; { Only insert the input entry if there is nothing in the dictionary that matches the key. }
- kReplace = 1; { Only replace the entries which match the key with the input entry. }
- kInsertOrReplace = 2; { Insert the entry if there is nothing in the dictionary which matches the key.
- If there is already matched entries, replace the existing matched entries with the input entry. }
-
- { This Was InsertMode }
-
- TYPE
- DictionaryDataInsertMode = INTEGER;
-
-
- CONST
- { Key attribute constants }
- kIsCaseSensitive = $10; { case sensitive = 16 }
- kIsNotDiacriticalSensitive = $20; { diac not sensitive = 32 }
-
- { Registered attribute type constants. }
- kNoun = -1;
- kVerb = -2;
- kAdjective = -3;
- kAdverb = -4;
-
- { This Was AttributeType }
-
- TYPE
- DictionaryEntryAttribute = SInt8;
-
- { Dictionary information record }
- DictionaryInformation = RECORD
- dictionaryFSSpec: FSSpec;
- numberOfRecords: LONGINT;
- currentGarbageSize: LONGINT;
- script: ScriptCode;
- maximumKeyLength: INTEGER;
- keyAttributes: SInt8;
- END;
- DictionaryAttributeTable = PACKED RECORD
- datSize: UInt8;
- datTable: PACKED ARRAY [0..0] OF DictionaryEntryAttribute;
- END;
- DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
-
-
- FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: INTEGER; keyAttributes: ByteParameter; script: ScriptCode): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0500, $AA53;
- {$ENDC}
- FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: ByteParameter; VAR dictionaryReference: LONGINT): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0501, $AA53;
- {$ENDC}
- FUNCTION CloseDictionary(dictionaryReference: LONGINT): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0202, $AA53;
- {$ENDC}
- FUNCTION InsertRecordToDictionary(dictionaryReference: LONGINT; key: ConstStr255Param; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0703, $AA53;
- {$ENDC}
- FUNCTION DeleteRecordFromDictionary(dictionaryReference: LONGINT; key: ConstStr255Param): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0404, $AA53;
- {$ENDC}
- FUNCTION FindRecordInDictionary(dictionaryReference: LONGINT; key: ConstStr255Param; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0805, $AA53;
- {$ENDC}
- FUNCTION FindRecordByIndexInDictionary(dictionaryReference: LONGINT; recordIndex: LONGINT; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0A06, $AA53;
- {$ENDC}
- FUNCTION GetDictionaryInformation(dictionaryReference: LONGINT; VAR theDictionaryInformation: DictionaryInformation): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0407, $AA53;
- {$ENDC}
- FUNCTION CompactDictionary(dictionaryReference: LONGINT): OSErr;
- {$IFC NOT GENERATINGCFM}
- INLINE $303C, $0208, $AA53;
- {$ENDC}
-
- {$ALIGN RESET}
- {$POP}
-
- {$SETC UsingIncludes := DictionaryIncludes}
-
- {$ENDC} {__DICTIONARY__}
-
- {$IFC NOT UsingIncludes}
- END.
- {$ENDC}
-